<template >
  <div class="con">
    <div class="contbox6_10" v-if="showType == 0">
      <!-- 普通创建页 -->
      <p class="titlelist6_10 titlser">
        机构管理
        <span style="color: #999">&nbsp;&nbsp;/&nbsp;&nbsp;</span>机构列表
        <span style="color: #999">&nbsp;&nbsp;/&nbsp;&nbsp;</span>
        {{ huinbian }}机构
      </p>
      <div class="content">
        <div class="jibenInfo">基本信息</div>
        <el-form
          ref="form"
          key="form"
          :rules="rules"
          :model="form"
          label-width="150px"
        >
          <el-form-item
            class="list"
            v-if="disabledSelect != 0"
            label="机构类型"
          >
            <el-select
              v-if="disabledSelect != 0"
              v-model="nvalue"
              @change="changeType"
              style="width: 350px"
              placeholder="请选择"
            >
              <el-option
                v-for="item in noptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="实名认证" class="list">
            <el-input
              style="width: 350px"
              :disabled="true"
              v-model="form.authStatus"
            ></el-input>
          </el-form-item>
          <el-form-item
            class="list"
            label="机构名称"
            style="float: leeft"
            prop="officeName"
          >
            <el-input v-model="form.officeName" maxlength="50" style="width: 350px"></el-input>
          </el-form-item>
          <el-form-item class="list" label="归属机构" prop="toOfficeName">
            <el-input
              v-model="form.toOfficeName"
              readonly
              placeholder="请选择归属机构"
              style="width: 350px"
              @focus="selectInstitution"
              @change="selectOffice()"
            />
          </el-form-item>
          <el-form-item class="list" label="联系人" prop="master">
            <el-input
              v-model="form.master"
              maxlength="10"
              style="width: 350px"
            ></el-input>
          </el-form-item>
          <el-form-item class="list" label="登录手机号" prop="phone">
            <el-input
              maxlength="11"
              onkeyup="value=value.replace(/[^\d]+/g,'')"
              placeholder="登录账号：手机号，初始密码：a+手机号后8位"
              v-model="form.phone"
              style="width: 350px"
            ></el-input>
          </el-form-item>

          <el-form-item
            class="list"
            label="电子邮箱"
            style="width: 350px; float: left"
          >
            <el-input
              v-model="form.email"
              style="width: 350px; margin-right: 40px"
            ></el-input>
          </el-form-item>
          <el-form-item
            label="联系地址"
            class="adrs"
            id="adrs"
            style="float: left"
          >
            <div style="display: flex">
              <el-select
                class="appointVip"
                v-model="form.areaId"
                placeholder="请选择省"
                @change="city(2)"
              >
                <el-option
                  v-for="(val, index) in provinceArr"
                  :label="val.name"
                  :value="val.code"
                  :key="index"
                ></el-option>
              </el-select>
              <el-select
                class="appointVip"
                v-model="form.city"
                placeholder="请选择市"
                @change="county()"
              >
                <el-option
                  v-for="(val, index) in cityArr"
                  :label="val.name"
                  :value="val.code"
                  :key="index"
                ></el-option>
              </el-select>
              <el-select
                class="appointVip"
                v-model="form.county"
                placeholder="请选择县"
              >
                <el-option
                  v-for="(val, index) in countryArr1"
                  :label="val.name"
                  :value="val.code"
                  :key="index"
                ></el-option>
              </el-select>
              <el-input
                class="detailAddress"
                placeholder="请输入具体联系地址"
                v-model="form.address"
                style="width: 404px; margin-left: 10px"
                :maxlength="adsDetail"
              ></el-input>
            </div>
          </el-form-item>
          <div v-if="false">
            <div class="jibenInfo">
              提现规则(创建一级代理可新建或选择已有，创建二级及以下则默认直属一代上级费率)
            </div>
            <el-form-item
              class="lists"
              label="代付手续费"
              prop="singleDrawServiceCharge"
            >
              <el-input
                style="width: 200px"
                maxlength="6"
                @input="value=>{form.singleDrawServiceCharge=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}"
                v-model="form.singleDrawServiceCharge"
              ></el-input>
              元
            </el-form-item>
            <el-form-item class="lists" label="提现分润税率" prop="taxRate">
              <el-input
                style="width: 200px"
                @input="value=>{form.taxRate=value.replace(/^\D*(\d*(?:\.\d{0,3})?).*$/g, '$1')}"
                v-model="form.taxRate"
              ></el-input>
              %
            </el-form-item>
            <el-form-item
              class="lists"
              label="单笔提现最低金额"
              prop="singleDrawAmt"
            >
              <el-input
                style="width: 200px"
                @input="value=>{form.singleDrawAmt=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}"
                v-model="form.singleDrawAmt"
              ></el-input>
              元
            </el-form-item>
            <el-form-item
              class="lists"
              label="单日封顶提现"
              prop="dayDrawmaxAmt"
            >
              <el-input
                style="width: 200px"

                @input="value=>{form.dayDrawmaxAmt=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}"
                v-model="form.dayDrawmaxAmt"
              ></el-input>
              元/笔
            </el-form-item>
            <el-form-item
              class="lists"
              label="单日最大提现次数"
              prop="dayDrawmaxCnt"
            >
              <el-input
                style="width: 200px"
                @input="value=>{form.dayDrawmaxCnt=value.replace(/[^\d]+/g,'')}"
                v-model="form.dayDrawmaxCnt"
              ></el-input>
              次
            </el-form-item>
          </div>
          <el-col
            class="boxer"
            style="width: 95%; margin: 60px auto; padding-bottom: 20px"
          >
            <el-button
              type="primary"
              style="margin-right: 50%; margin-left: 10px"
              @click="agent()"
              >完成</el-button
            >
            &nbsp;&nbsp;&nbsp;&nbsp;
            <el-button @click="shangyi">取消</el-button>
          </el-col>
        </el-form>
      </div>
    </div>
    <!-- 创建小o单 -->
    <div class="contbox6_10" v-if="showType == 2">
      <!-- oem创建页 -->
      <p class="titlelist6_10" style="font-size: 16px">
        机构管理
        <span style="color: #999; font-size: 16px"
          >&nbsp;&nbsp;/&nbsp;&nbsp;</span
        >机构列表 /
        <span style="font-size: 16px">{{ huinbian }}机构</span>
      </p>
      <div class="content">
        <el-form
          ref="form1"
          key="form1"
          :rules="rules1"
          :model="form1"
          label-width="160px"
        >
          <div>
            <div class="jibenInfo">基本信息</div>

            <el-form-item class="list" label="机构类型" style="width: 520px">
              <div v-if="showBool == 2">{{form1.agtType=="0"?'OEM':'渠道机构'}}</div>

              <el-select
                style="width: 350px"
                v-if="disabledSelect != 0"
                v-model="nvalue"
                @change="changeType"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in noptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item
              class="list"
              label="服务商编号"
              style="width: 350px; float: left"
              prop="hkproCode"
            >
              <el-input
                placeholder="请输入海科服务商编号"
                v-model="form1.hkproCode"
                maxlength="32"
                onkeyup="value=value.replace(/[^\w\.\/]/ig,'')"
                style="width: 350px; margin-right: 40px"
              ></el-input>
            </el-form-item>

            <el-form-item
              class="list"
              label="机构名称"
              style="width: 350px; float: left"
              prop="officeName"
            >
              <el-input
                v-model="form1.officeName"
                maxlength="30"
                style="width: 350px; margin-right: 40px"
              ></el-input>
            </el-form-item>
            <el-form-item
              prop="master"
              class="list"
              label="联系人"
              style="width: 350px; float: left"
            >
              <el-input
                v-model="form1.master"
                maxlength="10"
                style="width: 350px; margin-right: 40px"
              ></el-input>
            </el-form-item>
            <el-form-item
              prop="phone"
              class="list"
              label="登录手机号"
              style="width: 350px; float: left; magin-bottom: 0"
            >
              <el-input
                maxlength="11"
                onkeyup="value=value.replace(/[^\d]+/g,'')"
                v-model="form1.phone"
                style="width: 350px; margin-right: 40px"
                placeholder="登录账号：手机号，初始密码：a+手机号后8位"
              ></el-input>
              <!-- <span></span> -->
            </el-form-item>
            <el-form-item
              class="list"
              label="电子邮箱"
              style="width: 350px; float: left"
            >
              <el-input
                v-model="form1.email"
                style="width: 350px; margin-right: 40px"
              ></el-input>
            </el-form-item>
            <div style="clear: both"></div>
            <el-form-item label="联系地址" class="adrs" style="float: left">
              <div class="" style="display: flex">
                <el-select
                  class="appointVip"
                  v-model="form1.areaId"
                  placeholder="请选择省"
                  @change="city(2)"
                >
                  <el-option
                    v-for="(val, index) in provinceArr"
                    :label="val.name"
                    :value="val.code"
                    :key="index"
                  ></el-option>
                </el-select>
                <el-select
                  class="appointVip"
                  v-model="form1.city"
                  placeholder="请选择市"
                  @change="county()"
                >
                  <el-option
                    v-for="(val, index) in cityArr"
                    :label="val.name"
                    :value="val.code"
                    :key="index"
                  ></el-option>
                </el-select>
                <el-select
                  class="appointVip"
                  v-model="form1.county"
                  placeholder="请选择县"
                >
                  <el-option
                    v-for="(val, index) in countryArr1"
                    :label="val.name"
                    :value="val.code"
                    :key="index"
                  ></el-option>
                </el-select>
                <el-input
                  v-model="form1.address"
                  placeholder="请输入具体联系地址"
                  class="detailAddress"
                  :maxlength="adsDetail"
                  style="width: 404px; margin-left: 10px"
                ></el-input>
              </div>
            </el-form-item>
            <el-form-item label="经营范围" v-if="false">
              <el-input
                style="width: 922px"
                type="textarea"
                v-model="form1.mccCont"
              ></el-input>
            </el-form-item>
          </div>

          <!-- 实名信息 -->
          <div class="jibenInfo">实名信息</div>
          <div>
            <el-form-item label="实名" class="list" prop="accountName">
                <el-input
                  v-model="realNameData.name"
                  style="width: 350px"
                ></el-input>
              </el-form-item>
          </div>



          <div v-if="form.toOfficeUid == guishups || huinbian == '编辑'">
            <div v-if="false">
              <div class="jibenInfo">银行卡</div>
              <el-form-item label="账户类型" class="list" prop="accountType">
                <el-select
                  filterable
                  v-model="form1.accountType"
                  class="selects"
                  style="width: 350px"
                  placeholder="请选择账户类型"
                >
                  <el-option label="对公" value="1"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="账户名称" class="list" prop="accountName">
                <el-input
                  v-model="form1.accountName"
                  style="width: 350px"
                ></el-input>
              </el-form-item>
              <el-form-item label="开户银行" class="list" prop="bankCode">
                <el-select
                  class="selects"
                  filterable
                  v-model="form1.bankCode"
                  placeholder="请选择开户银行"
                  @change="bankChange(1)"
                >
                  <el-option
                    :label="item.bankName"
                    :value="item.bankCode"
                    v-for="(item, index) in bankList"
                    :key="index"
                  ></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="开户地区" class="list" prop="openCity">
                <el-select
                  class="appointVips"
                  v-model="form1.openProvince"
                  placeholder="请选择省"
                  @change="citys(2)"
                >
                  <el-option
                    v-for="(val, index) in provinceArr"
                    :label="val.name"
                    :value="val.code"
                    :key="index"
                  ></el-option>
                </el-select>
                <el-select
                  class="appointVips"
                  v-model="form1.openCity"
                  placeholder="请选择市"
                  @change="handleChanges(1)"
                >
                  <el-option
                    v-for="(val, index) in paizi3"
                    :label="val.name"
                    :value="val.code"
                    :key="index"
                  ></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="开户支行" class="list" prop="openBankCode">
                <el-select
                  class="selects"
                  v-model="form1.openBankCode"
                  placeholder="请选择开户支行"
                >
                  <el-option
                    :label="item.subName"
                    :value="item.subCode"
                    v-for="(item, index) in branchList"
                    :key="index"
                  ></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="开户账号" class="list" prop="accountNo">
                <el-input
                  v-model="form1.accountNo"
                  style="width: 350px"
                ></el-input>
              </el-form-item>
              <el-form-item label="身份证号" class="list" prop="certNbr">
                <el-input
                  onkeyup="value=value.replace(/[^\w\/]/ig,'')"
                  maxlength="18"
                  v-model="form1.certNbr"
                  style="width: 350px"
                ></el-input>
              </el-form-item>
              <el-form-item
                label="开户手机号"
                class="list"
                prop="reservedMobile"
              >
                <el-input
                  maxlength="11"
                  onkeyup="value=value.replace(/[^\d]+/g,'')"
                  v-model="form1.reservedMobile"
                  style="width: 350px"
                ></el-input>
              </el-form-item>
            </div>
          </div>

          <div v-if="false">
            <div class="jibenInfo">
              设置提现规则 (创建一级代理可新建或选择已有，创建二级及以下则默认直属一代上级费率)
            </div>

            <div class="withdrawal">
              <el-form-item
                label="代付手续费"
                class="lists"
                id="bankTile"
                prop="singleDrawServiceCharge"
              >
                <el-input
                  v-model="form1.singleDrawServiceCharge"
                  maxlength="6"
                   @input="value=>{form1.singleDrawServiceCharge=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}"
                  style="width: 200px"
                ></el-input>
                <span>元</span>
              </el-form-item>
              <el-form-item
                label="提现分润税率"
                class="lists"
                id="bankTile"
                prop="taxRate"
              >
                <el-input
                  v-model="form1.taxRate"
                  maxlength="6"
                  @input="value=>{form1.taxRate=value.replace(/^\D*(\d*(?:\.\d{0,3})?).*$/g, '$1')}"
                  style="width: 200px"
                ></el-input>
                <span>%</span>
              </el-form-item>
              <el-form-item
                label="单笔最低提现金额"
                class="lists"
                prop="singleDrawAmt"
              >
                <el-input
                  v-model="form1.singleDrawAmt"
                  maxlength="10"
                  @input="value=>{form1.singleDrawAmt=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}"
                  style="width: 200px"
                ></el-input>
                <span>元</span>
              </el-form-item>
              <el-form-item
                label="单日封顶提现"
                class="lists"
                prop="dayDrawmaxAmt"
              >
                <el-input
                  v-model="form1.dayDrawmaxAmt"
                  maxlength="10"
                  @input="value=>{form1.dayDrawmaxAmt=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}"
                  style="width: 200px"
                ></el-input>
                <span>元</span>
              </el-form-item>
              <el-form-item
                label="单日最大提现次数"
                class="lists"
                prop="dayDrawmaxCnt"
              >
                <el-input
                  v-model="form1.dayDrawmaxCnt"
                  maxlength="3"
                  @input="value=>form1.dayDrawmaxCnt=value.replace(/[^\d]+/g,'')"
                  style="width: 200px"
                ></el-input>
                <span>次</span>
              </el-form-item>
            </div>
          </div>
          <div v-if="false">
            <div class="jibenInfo">资质</div>
            <el-form-item style="width: 100%" label-width="20px">
              <div style="float: left; margin-left: 20px">
                <el-upload
                  :class="uploadDisabled"
                  :action="httpurl + '/api/fileUpload'"
                  list-type="picture-card"
                  :file-list="imgData4"
                  :limit="1"
                  name="file"
                  accept=".jpg,.jpeg,.png,.JPG,.JPEG,.PNG"
                  :before-upload="beforeUpload"
                  :on-success="handleSuccess4"
                  :on-preview="handlePictureCardPreview4"
                  :on-remove="handleRemove4"
                >
                  <i class="el-icon-plus"></i>
                </el-upload>
                <el-dialog :visible.sync="dialogVisible4">
                  <img width="100%" :src="dialogImageUrl4" alt="" />
                </el-dialog>
                <p>营业执照</p>
              </div>
              <div style="float: left; margin-left: 20px">
                <el-upload
                  :class="uploadDisabled5"
                  :action="httpurl + '/api/fileUpload'"
                  list-type="picture-card"
                  :file-list="imgData5"
                  :limit="1"
                  name="file"
                  accept=".jpg,.jpeg,.png,.JPG,.JPEG,.PNG"
                  :before-upload="beforeUpload"
                  :on-success="handleSuccess5"
                  :on-preview="handlePictureCardPreview5"
                  :on-remove="handleRemove5"
                >
                  <i class="el-icon-plus"></i>
                </el-upload>
                <el-dialog :visible.sync="dialogVisible5">
                  <img width="100%" :src="dialogImageUrl5" alt="" />
                </el-dialog>
                <p>开户许可证</p>
              </div>
              <div style="float: left; margin-left: 20px">
                <el-upload
                  :class="uploadDisabled6"
                  :action="httpurl + '/api/fileUpload'"
                  list-type="picture-card"
                  :file-list="imgData6"
                  :limit="1"
                  name="file"
                  accept=".jpg,.jpeg,.png,.JPG,.JPEG,.PNG"
                  :before-upload="beforeUpload"
                  :on-success="handleSuccess6"
                  :on-preview="handlePictureCardPreview6"
                  :on-remove="handleRemove6"
                >
                  <i class="el-icon-plus"></i>
                </el-upload>
                <p>法人身份证正面</p>
                <el-dialog :visible.sync="dialogVisible6">
                  <img width="100%" :src="dialogImageUrl6" alt="" />
                </el-dialog>
              </div>
              <div style="float: left; margin-left: 20px">
                <el-upload
                  :class="uploadDisabled7"
                  :action="httpurl + '/api/fileUpload'"
                  list-type="picture-card"
                  :file-list="imgData7"
                  :limit="1"
                  name="file"
                  accept=".jpg,.jpeg,.png,.JPG,.JPEG,.PNG"
                  :before-upload="beforeUpload"
                  :on-success="handleSuccess7"
                  :on-preview="handlePictureCardPreview7"
                  :on-remove="handleRemove7"
                >
                  <i class="el-icon-plus"></i>
                </el-upload>
                <el-dialog :visible.sync="dialogVisible7">
                  <img width="100%" :src="dialogImageUrl7" alt="" />
                </el-dialog>
                <p>法人身份证反面</p>
              </div>
              <div style="float: left; margin-left: 20px">
                <el-upload
                  :class="uploadDisabled8"
                  :action="httpurl + '/api/fileUpload'"
                  list-type="picture-card"
                  :file-list="imgData8"
                  :limit="1"
                  name="file"
                  accept=".jpg,.jpeg,.png,.JPG,.JPEG,.PNG"
                  :before-upload="beforeUpload"
                  :on-success="handleSuccess8"
                  :on-preview="handlePictureCardPreview8"
                  :on-remove="handleRemove8"
                >
                  <i class="el-icon-plus"></i>
                </el-upload>
                <el-dialog :visible.sync="dialogVisible8">
                  <img width="100%" :src="dialogImageUrl8" alt="" />
                </el-dialog>
                <p>银行卡照片</p>
              </div>
            </el-form-item>
          </div>
        </el-form>
        <div style="clear: both"></div>
        <el-col
          class="boxer"
          style="width: 95%; margin: 60px auto; padding-bottom: 20px"
        >
          &nbsp;&nbsp;&nbsp;&nbsp;
          <el-button
            @click="shangyi"
            style="margin-right: 40%; margin-left: 10px"
            >取消</el-button
          >
          &nbsp;&nbsp;&nbsp;&nbsp;
          <el-button type="primary" @click="oemsnb()">完成</el-button>
        </el-col>
      </div>
    </div>
    <Tree :showType="showTypeaa" @func="transmit" />
  </div>
</template>

<script>
import {
  regionData,
  provinceAndCityData,
  CodeToText,
  TextToCode,
} from "element-china-area-data";
import { adsDetail } from "../../../plugins/rules";
import { email } from "../../../assets/js/commion";
import Tree from "../../tree/index";
import axios from "axios";
import { Alert } from "element-ui";
export default {
  name: "route",
  data() {
    return {
      realNameData:"", //实名数据 
      adsDetail: adsDetail,
      loading: true,
      uploadDisabled: "",
      uploadDisabled5: "",
      uploadDisabled6: "",
      uploadDisabled7: "",
      uploadDisabled8: "",
      disabled: false,
      rules: {
        // status: [
        //   { required: true, message: "请选择启用类型", trigger: "blur" },
        // ],
        officeName: [
          { required: true, message: "请输入机构名称", trigger: "blur" },
        ],
        toOfficeName: [
          { required: true, message: "请选择归属机构", trigger: "change" },
        ],
        phone: [{ required: true, message: "请输入机构电话", trigger: "blur" }],
        master: [{ required: true, message: "请输入联系人", trigger: "blur" }],
        // channelUid: [
        //   { required: true, message: "请选择权益", trigger: "blur" }
        // ],
        singleDrawServiceCharge: [
          { required: true, message: "请输入代付手续费", trigger: "blur" },
        ],
        taxRate: [
          { required: true, message: "请输入代付手续费率", trigger: "blur" },
        ],
        singleDrawAmt: [
          {
            required: true,
            message: "请输入单笔提现最低金额",
            trigger: "blur",
          },
        ],
        dayDrawmaxAmt: [
          { required: true, message: "请输入单日封顶提现", trigger: "blur" },
        ],
        dayDrawmaxCnt: [
          {
            required: true,
            message: "请输入单日最大提现次数",
            trigger: "blur",
          },
        ],
      },
      Area: [],
      branchList: [], // 开户支行
      rules1: {
        // status: [
        //   { required: true, message: "请选择启用类型", trigger: "blur" },
        // ],
        officeName: [
          { required: true, message: "请输入机构名称", trigger: "blur" },
        ],
        organizCode: [
          { required: true, message: "请输入营业执照号", trigger: "blur" },
        ],
        legalPersonName: [
          { required: true, message: "请输入法人姓名", trigger: "blur" },
        ],
        legalPersonIdCard: [
          { required: true, message: "请输入法人证件号", trigger: "blur" },
        ],
        organizCode: [
          { required: true, message: "请输入营业执照号", trigger: "blur" },
        ],
        openCity: [
          { required: true, message: "请选择开户地区", trigger: "change" },
        ],
        master: [{ required: true, message: "请输入联系人", trigger: "blur" }],
        phone: [{ required: true, message: "请输入登录手机号", trigger: "blur" }],

        accountType: [
          { required: true, message: "请选择账户类型", trigger: "blur" },
        ],
        accountName: [
          { required: true, message: "请输入账户名称", trigger: "blur" },
        ],
        bankCode: [
          { required: true, message: "请选择开户银行", trigger: "change" },
        ],
        openBankCode: [
          { required: true, message: "请选择开户支行", trigger: "change" },
        ],
        accountNo: [
          { required: true, message: "请输入开户账号", trigger: "blur" },
        ],
        certNbr: [
          { required: true, message: "请输入身份证号", trigger: "blur" },
        ],
        reservedMobile: [
          { required: true, message: "请输入开户手机号", trigger: "blur" },
        ],

        singleDrawServiceCharge: [
          { required: true, message: "请输入代付手续费", trigger: "blur" },
        ],
        taxRate: [
          { required: true, message: "请输入代付手续费率", trigger: "blur" },
        ],
        singleDrawAmt: [
          {
            required: true,
            message: "请输入单笔提现最低金额",
            trigger: "blur",
          },
        ],
        dayDrawmaxAmt: [
          { required: true, message: "请输入单日封顶提现", trigger: "blur" },
        ],
        dayDrawmaxCnt: [
          {
            required: true,
            message: "请输入单日最大提现次数",
            trigger: "blur",
          },
        ],
        // hkproCode: [
        //   { required: true, message: "请输入海科服务商编号", trigger: "blur" },
        // ],
        // genKey: [{ required: true, message: "请输入机构秘钥", trigger: "blur" }]
      },
      dialogVisible: false,
      dialogVisible1: false,
      dialogVisible2: false,
      dialogVisible3: false,
      dialogVisible4: false,
      dialogVisible5: false,
      dialogVisible6: false,
      dialogVisible7: false,
      dialogVisible8: false,
      dialogVisible9: false,
      dialogImageUrl: "",
      dialogImageUrl1: "",
      dialogImageUrl2: "",
      dialogImageUrl3: "",
      dialogImageUrl4: "",
      dialogImageUrl5: "",
      dialogImageUrl6: "",
      dialogImageUrl7: "",
      dialogImageUrl8: "",
      dialogImageUrl9: "",
      imgData: [],
      imgData1: [],
      imgData2: [],
      imgData3: [],
      imgData4: [],
      imgData5: [],
      imgData6: [],
      imgData7: [],
      imgData8: [],
      imgData9: [],
      dataes: "",
      shobols: "", //控制提现规则显示与否
      optionsrule: [
        {
          value: "0",
          label: "元",
        },
        {
          value: "1",
          label: "率",
        },
      ], //
      rule: "0", //提现规则
      shows: "",
      mechanism: "",
      temp: "",
      showTypeaa: false,
      enable: [
        {
          value: "0",
          label: "启用",
        },
        {
          value: "1",
          label: "停用",
        },
      ],
      value: "",
      status: [
        {
          value: "0",
          label: "启用",
        },
        {
          value: "1",
          label: "停用",
        },
      ],
      noptions: [
        {
          value: "0",
          label: "普通代理",
        },
        {
          value: "1",
          label: "OEM",
        },
      ],
      httpurl: this.GLOBAL.httpurl,
      nvalue: "普通代理",
      nvalueArr: ["普通代理", "OEM"],
      showType: null, //显示谁
      newType: "",
      huinbian: "",
      huixiantype: "",
      huiyuanzhazi: [],
      provinceArr: [],
      cityArr: [],
      countryArr1: [],
      paizi3: [],
      guishu: [],
      guishups: "",
      options: regionData,
      option: provinceAndCityData,
      selectedOptions: [],
      type: 0,
      activeName: "first",
      tongdao: [],
      bankList: [], //开户银行
      jurisdiction: null,
      form: {
        authStatus: "未实名",
        level: "", //权益级别
        merName: "", //
        oemUid: "",
        singleDrawServiceCharge: "", //银行代理手续费（元/笔）
        agtType: 1,
        officeUid: "",
        toOfficeUid: "",
        channelUid: "",
        merUid: "",
        status: "0",
        officeName: "",
        master: "",
        phone: "",
        email: "",
        areaId: "",
        city: "",
        county: "",
        address: "",
        taxRate: "",
        dayDrawmaxAmt: "",
        dayDrawmaxCnt: "",
        accountName: "",
        certNbr: "",
        bankCode: "",
        accountNo: "",
        taxRate: "",
        singleDrawServiceCharge: "",
        singleDrawAmt: "",
        dayDrawmaxAmt: "",
        dayDrawmaxCnt: "",
        toOfficeName: null,
        payCost: "", //银行支付手续费
      },
      form1: {
        // 服务商编号
        openCity: "",
        hkproCode: "",
        bankCardPhoBack: "",
        channelId: "", //品牌
        // behalfPayCost: "",
        payCost: "", //银行支付手续费率%
        agtType: "",
        officeUid: "", //机构id
        status: "0", //启用类型
        officeName: "", //机构名称
        master: "", //负责人
        phone: "", //手机号
        email: "", //邮箱
        areaId: "", // 省
        city: "", // 市
        county: "", //县
        address: "", //详细地址

        appId: "", //支付宝appid
        aliNo: "", // 支付宝账号
        aliName: "", //联系人姓名
        aliEmail: "", //电子邮箱
        aliPhone: "", //机构电话

        accountType: "1",
        accountName: "",
        bankCode: "", //开户银行
        bankCode: "",
        certNbr: "",
        reservedMobile: "",
        bill: "", //是否提供发票
        taxPoint: "", //结算水电
        settlementPeriod: "",

        //提现规则
        // payCosta: "", //银行支付手续费
        // singleDrawServiceCharge: "", //银行代付手续费  提现单笔手续费
        // taxRate: "", //银行代付手续费百分比   提现税率
        // singleDrawAmt: "", //最低手续费
        // dayDrawmaxAmt: "", //单日封顶
        // dayDrawmaxCnt: "", //提现次数

        // isFlag: "1", //分账权限
        // custName: "", //公司名称
        // organizCode: "", //组织机构代码
        // accountNo: "", //企业对公账号
        // principalPhone: "", //企业预留经办人手机号
        // legalPersonName: "", //法人姓名
        // legalPersonIdCard: "", //法人证件号

        // behalfPayCost: "", //银行代付手续费%
        // singleBehalfPayCost: "", //银行代付手续费（元/笔）
        // tallBehalfPayCost: "", //手续费最高扣款金额（元/笔）
        // tallTaxPoint: "" //手续费最高比例（%）
      },
      dialogImageUrl: "",
    };
  },
  created() {
    //
    console.log(localStorage.getItem("jurisdiction"));
    if (localStorage.getItem("jurisdiction") == "2") {
      this.nvalue = "OEM";
      this.noptions = [
        {
          value: "1",
          label: "OEM",
        },
        {
          value: "3",
          label: "渠道机构",
        }
      ];

      if (this.$route.query.list == "OEM") {
        this.showType = 2;
      } else if (this.$route.query.list == "普通代理") {
        this.showType = 0;
      } else {
        this.showType = 2;
      }
    } else {
      this.nvalue = "普通代理";
      this.noptions = [
        {
          value: "0",
          label: "普通代理",
        }
      ];

      if (this.$route.query.list == "OEM") {
        this.showType = 2;
      } else if (this.$route.query.list == "普通代理") {
        this.showType = 0;
      } else {
        this.showType = 0;
      }
      axios
        .post("/api/office/selectDrawRule", {
          oemUid: localStorage.getItem("uid"),
        })
        .then((d) => {
          console.log(this);
          this.form.taxRate = d.data.officeInfo.taxRate;
          this.form.singleDrawServiceCharge =d.data.officeInfo.singleDrawServiceCharge;
          this.form.singleDrawAmt = d.data.officeInfo.singleDrawAmt;
          this.form.dayDrawmaxAmt = d.data.officeInfo.dayDrawmaxAmt;
          this.form.dayDrawmaxCnt = d.data.officeInfo.dayDrawmaxCnt;
        });
    }
    this.disabledSelect = sessionStorage.getItem("selectDisbled");
    this.shows = sessionStorage.getItem("shows");
    this.showBool = this.$route.query.showBool;

    // 判断是否是修改或查看
    let uid = this.$route.query.id;
    if (uid) {
      this.loading = true;
    }
  },
  mounted: function () {
    window.scrollTo(0, 0);
    var _this = this;
    _this.type = sessionStorage.getItem("newType");
    _this.huinbian = sessionStorage.getItem("huinbian");
    _this.huixianid = sessionStorage.getItem("huixianid");
    _this.jurisdiction = localStorage.getItem("jurisdiction");
    _this.LoginId = sessionStorage.getItem("LoginId");

    _this.getDataVal();
    _this.openBankList(); //开户银行
    _this.area(); // 省

    _this.form = {
      authStatus: "未实名",
      level: "", //权益级别
      merName: "", //
      oemUid: "", //oem编号
      agtType: 1, // 代表普通代理
      officeUid: "", //机构id
      toOfficeUid: "", //归属机构id
      channelUid: "", //
      merUid: "", //权益uid
      status: "0", //启用类型
      officeName: "", //机构名称
      master: "", //负责人
      phone: "", //练习电话
      email: "", //电子邮箱
      areaId: "", //省份编码
      city: "", //城市编码
      county: "", //县区编码
      address: "", //详细地址
      taxRate: "", //银行代付手续费率
      toOfficeName: null,
        singleDrawAmt: "",
        dayDrawmaxAmt: "",
        dayDrawmaxCnt: "",
      singleDrawServiceCharge: "",
      //payCost: "", //银行支付手续费率    this.form.bankPayment
      singleDrawServiceCharge: "", //银行代付手续费(元/笔)
      // taxRate : this.form.bankPaid, //银行代付手续费率
    };
    _this.form1 = {
      openCity: "",
      bankCardPhoBack: "",
      channelId: "",
      openCity: "",
      // behalfPayCost: "",
      payCost: "",
      agtType: 0,
      officeUid: "",
      dayDrawmaxAmt: "",
      status: "0",
      officeName: "",
      master: "",
      phone: "",
      email: "",
      areaId: "",
      city: "",
      county: "",
      address: "",
      appid: "",
      aliNo: "",
      aliName: "",
      aliEmail: "",
      aliPhone: "",
      accountType: "1",
      accountName: "",
      accountNo: "",
      bankCode: "", //开户银行
      bankCode: "",
      certNbr: "",
      reservedMobile: "",
      bill: "",
      taxPoint: "",
      settlementPeriod: "",
      isFlag: "1", //分账权限
      custName: "", //公司名称
      organizCode: "", //组织机构代码
      accountNo: "", //企业对公账号
      principalPhone: "", //企业预留经办人手机号
      legalPersonName: "", //法人姓名
      legalPersonIdCard: "", //法人证件号
      behalfPayCost: "", //银行代付手续费%
      singleBehalfPayCost: "", //银行代付手续费（元/笔）
      tallBehalfPayCost: "", //手续费最高扣款金额（元/笔）
      tallTaxPoint: "", //手续费最高比例（%）
    };
    if (
      sessionStorage.getItem("huixianid") &&
      sessionStorage.getItem("huixianid") != ""
    ) {
      _this.echoData();
    } else {
    }
    setTimeout(() => {
      this.shobols = this.$route.query.showBool;
    }, 100);
  },
  components: {
    Tree,
  },

  methods: {
    // 省
    area() {
      axios
        .post("/area/province")
        .then((res) => {
          this.provinceArr = res.data;
        })
        .catch((err) => {});
    },
    //市
    city(val) {
      console.log(val);
      if (val == 1) {
      } else {
        this.form1.city = "";
        this.form.city = "";
        this.form1.county = "";
        this.form.county = "";
      }
      axios
        .post("/area/city", {
          upCode: this.form1.areaId
            ? this.form1.areaId
            : this.form.areaId
            ? this.form.areaId
            : this.form1.openProvince,
        })
        .then((res) => {
          this.cityArr = res.data;
        });
    },
    // 区域
    citys(val) {
      console.log(val);
      if (val == 2) {
        this.form1.openCity = "";
      }
      axios
        .post("/area/city", { upCode: this.form1.openProvince })
        .then((res) => {
          this.paizi3 = res.data;
        });
    },
    // 区
    county(val) {
      if (val != 1) {
        this.form1.county = "";
        this.form.county = "";
      }
      axios
        .post("/area/county", {
          upCode: this.form1.city ? this.form1.city : this.form.city,
        })
        .then((res) => {
          this.countryArr1 = res.data;
        });
    },
    // 身份证正面照
    handleSuccess(res, file, fileList) {
      this.form.certFace = res.data.filePath;
      console.log(this.form);
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
    // 身份证反面照
    handleSuccess1(res, file, fileList) {
      this.form.certBack = res.data.filePath;
      console.log(this.form);
    },
    handlePictureCardPreview1(file) {
      this.dialogImageUrl1 = file.url;
      this.dialogVisible1 = true;
    },
    // 手持身份证照
    handleSuccess2(res, file, fileList) {
      this.form.certBody = res.data.filePath;
      console.log(this.form);
    },
    handlePictureCardPreview2(file) {
      this.dialogImageUrl2 = file.url;
      this.dialogVisible2 = true;
    },
    // 银行卡照
    handleSuccess3(res, file, fileList) {
      this.form.bankCardPho = res.data.filePath;
      console.log(this.form);
    },
    handlePictureCardPreview3(file) {
      this.dialogImageUrl3 = file.url;
      this.dialogVisible3 = true;
    },
    // 营业执照
    handleSuccess4(res, file, fileList) {
      this.form1.busLicencePho = res.data.filePath;
      if (this.form1.busLicencePho.length > 0) {
        this.uploadDisabled = "disabled";
      }
      console.log(this.form);
    },
    // 删除图片
    handleRemove4() {
      this.form1.busLicencePho = "";
      this.uploadDisabled = "";
    },
    handlePictureCardPreview4(file) {
      this.dialogImageUrl4 = file.url;
      this.dialogVisible4 = true;
    },
    // 开户许可证
    handleSuccess5(res, file, fileList) {
      this.form1.openAccPho = res.data.filePath;
      if (this.form1.openAccPho.length > 0) {
        this.uploadDisabled5 = "disabled";
      }
      console.log(this.form);
    },
    // 删除
    handleRemove5() {
      this.form1.openAccPho = "";
      this.uploadDisabled5 = "";
    },
    handlePictureCardPreview5(file) {
      this.dialogImageUrl5 = file.url;
      this.dialogVisible5 = true;
    },
    // 法人正面照
    handleSuccess6(res, file, fileList) {
      this.form1.legalCertFrontPho = res.data.filePath;
      if (this.form1.legalCertFrontPho.length > 0) {
        this.uploadDisabled6 = "disabled";
      }
      console.log(this.form);
    },
    handleRemove6() {
      this.form1.legalCertFrontPho = "";
      this.uploadDisabled6 = "";
    },

    handlePictureCardPreview6(file) {
      this.dialogImageUrl6 = file.url;
      this.dialogVisible6 = true;
    },
    // 法人反面照
    handleSuccess7(res, file, fileList) {
      this.form1.legalCertBackPho = res.data.filePath;
      if (this.form1.legalCertBackPho.length > 0) {
        this.uploadDisabled7 = "disabled";
      }
      console.log(this.form);
    },
    // 删除上传的图片
    handleRemove7() {
      this.form1.legalCertBackPho = "";
      this.uploadDisabled7 = "";
    },
    handlePictureCardPreview7(file) {
      this.dialogImageUrl7 = file.url;
      this.dialogVisible7 = true;
    },
    // 银行卡正照片
    handleSuccess8(res, file, fileList) {
      this.form1.bankCardPho = res.data.filePath;
      if (this.form1.bankCardPho.length > 0) {
        this.uploadDisabled8 = "disabled";
      }
      console.log(this.form);
    },
    // 删除的图片
    handleRemove8() {
      this.form1.bankCardPho = "";
      this.uploadDisabled8 = "";
    },
    handlePictureCardPreview8(file) {
      this.dialogImageUrl8 = file.url;
      this.dialogVisible8 = true;
    },

    //这里开始  控制树的传值
    transmit(data) {
      // console.log(data.uid);
      //归属机构的uid
      this.form.toOfficeUid = data.uid;
      // console.log(this.form.officeUid);
      //归属机构名字
      this.form.toOfficeName = data.name;
      // this.form.toOfficeUid = data.uid
    },
    //设置取消的
    determine() {
      // alert("执行")
      this.showTypeaa = false;
    },

    selectInstitution() {
      this.showTypeaa = true;
    },
    //这里结束

    selectOffice() {
      var _this = this;
      // alert("执行")
      if (
        sessionStorage.getItem("huixianid") &&
        sessionStorage.getItem("huixianid") != ""
      ) {
        _this.guishups = _this.form.toOfficeUid;
      }
    },

    getDataVal() {
      return false;
      var _this = this;
      _this
        .axios({
          //axios请求
          method: "post",
          url: "/api/channel/queryChannel",
          data: {},
        })
        .then(function (d) {
          if (d.data.code == "0000") {
            _this.tongdao = d.data.data;
          } else {
            //   alert("这个执行")
            layer.open({
              content: d.data.msg,
              skin: "msg",
              time: 2, //1秒后自动关闭
            });
          }
        })
        .catch(function (error) {
          //axios请求失败回调
          console.log(error);
        });
    },
    // 省市区联系地址
    handleChange(value) {
      this.form.areaId = value[0];
      this.form.city = value[1];
      this.form.county = value[2];

      this.form1.areaId = value[0];
      this.form1.city = value[1];
      this.form1.county = value[2];
    },
    bankChange(val) {
      if (val) {
        this.form1.openBankCode = "";
      }
      this.form1.openBankCode = "";
      this.openBranchList(); // 开户支行
    },
    // 开户地区
    handleChanges(val) {
      // this.form1.openProvince = val[0];
      // this.form1.openCity = val[1];
      if (val) {
        this.form1.openBankCode = "";
      }
      this.form1.openBankCode = "";
      this.openBranchList(); // 开户支行
    },
    shangyi() {
      var _this = this;
      _this.$router.push({ name: "mechanismaa" });
      sessionStorage.setItem("huixianid", "");
      _this.$emit("type", 1);
    },
    handleClick(tab, event) {
      console.log(tab, event);
    },
    echoData() {
      console.log(5555567);
      var _this = this;
      _this
        .axios({
          //axios请求
          method: "post",
          url: "/api/office/getUpdateOfficeInfo",
          data: {
            officeUid: sessionStorage.getItem("huixianid"),
          },
        })
        .then(function (d) {
          if (d.data.code == "0000") {
            this.getUpdateOfficeInfo = d.data.data
            if (_this.type == 2) {
              _this.paizi3 = [];
              _this.form1 = d.data.data;
              _this.city(1);
              _this.citys(1);
              _this.county(1);
              _this.openBranchList();
              d.data.data.busLicencePho == ""
                ? (_this.imgData4 = [])
                : _this.imgData4.push({ url: d.data.data.busLicencePho });
              d.data.data.openAccPho == ""
                ? (_this.imgData5 = [])
                : _this.imgData5.push({ url: d.data.data.openAccPho });
              d.data.data.legalCertFrontPho == ""
                ? (_this.imgData6 = [])
                : _this.imgData6.push({ url: d.data.data.legalCertFrontPho });
              d.data.data.legalCertBackPho == ""
                ? (_this.imgData7 = [])
                : _this.imgData7.push({ url: d.data.data.legalCertBackPho });
              d.data.data.bankCardPho == ""
                ? (_this.imgData8 = [])
                : _this.imgData8.push({ url: d.data.data.bankCardPho });

              if (_this.imgData4.length > 0) {
                _this.uploadDisabled = "disabled";
              }
              if (_this.imgData5.length > 0) {
                _this.uploadDisabled5 = "disabled";
              }
              if (_this.imgData6.length > 0) {
                _this.uploadDisabled6 = "disabled";
              }
              if (_this.imgData7.length > 0) {
                _this.uploadDisabled7 = "disabled";
              }
              if (_this.imgData8.length > 0) {
                _this.uploadDisabled8 = "disabled";
              }
              setTimeout(() => {
                _this.loading = false;
              }, 500);
              // alert(_this.selectedOptions);
            } else if (_this.type == 0) {
              console.log("下面是普通回显的数据");

              _this.form = d.data.data;
              _this.city(1);
              _this.county(1);
              _this.imgData.push({ url: d.data.data.certFace });
              d.data.data.certBack == ""
                ? (_this.imgData1 = [])
                : _this.imgData1.push({ url: d.data.data.certBack });
              d.data.data.certBody == ""
                ? (_this.imgData2 = [])
                : _this.imgData2.push({ url: d.data.data.certBody });
              d.data.data.bankCardPho == ""
                ? (_this.imgData3 = [])
                : _this.imgData3.push({ url: d.data.data.bankCardPho });
              _this.form.merUid = d.data.data.merUid;
              _this.dataes = d.data.data.merUid;

              if (d.data.data.authStatus == "0") {
                _this.disabled = true;
                _this.form.authStatus = "已实名";
              } else {
                _this.form.authStatus = "未实名";
              }
              setTimeout(() => {
                _this.loading = false;
              }, 400);
            }
          } else {
            layer.open({
              content: d.data.msg,
              skin: "msg",
              time: 2, //1秒后自动关闭
            });
          }
        })
        .catch(function (error) {
          console.log(error);
        });
    },
    oemsnb() {
      if (email(this.form1.email) == false && this.form1.email!='') {
        layer.open({
          content: "邮箱输入有误",
          skin: "msg",
          time: 1, //1秒后自动关闭
        });
        return false;
      }
      var _this = this;
      console.log(454545, this.form1);
      if (
        _this.form1.phone == "" ||
        _this.form1.phone == undefined ||
        _this.form1.phone.length < 11 ||
        _this.form1.phone.length > 11
      ) {
        layer.open({
          content: "请填写正确的手机号！",
          skin: "msg",
          time: 2, //1秒后自动关闭
        });
        return false;
      }
      var regCn = /[·！#￥（——）：；“”‘、，|《。》？、【】[\] ]/im;
      if (regCn.test(_this.form1.phone)) {
        layer.open({
          content: "手机号码不能含有特殊字符",
          skin: "msg",
          time: 2, //1秒后自动关闭
        });
        return false;
      }

      if (/[a-zA-Z]/im.test(_this.form1.phone)) {
        layer.open({
          content: "手机号码不能含有字母",
          skin: "msg",
          time: 2, //1秒后自动关闭
        });
        return false;
      }
      if (!/^1[3|4|5|7|8|9][0-9]\d{4,8}$/.test(_this.form1.phone)) {
        layer.open({
          content: "手机号码填写有误",
          skin: "msg",
          time: 2, //1秒后自动关闭
        });
        return false;
      }
      this.form1.oemUid = localStorage.getItem("uid");
      console.log("传递的数据");
      console.log(this.form1);

      this.$refs["form1"].validate((valid) => {
        if (valid) {
          _this
            .axios({
              //axios请求
              method: "post",
              url: "/api/office/save",
              data: _this.form1,
            })
            .then(function (d) {
              if (d.data.code == "0000") {
                layer.open({
                  content: d.data.msg,
                  skin: "msg",
                  time: 3, //1秒后自动关闭
                });
                _this.$emit("type", 1);
                setTimeout(() => {
                  _this.$router.push({
                    path: "mechanismaa",
                  });
                }, 3000);
              } else {
                layer.open({
                  content: d.data.msg,
                  skin: "msg",
                  time: 2, //1秒后自动关闭
                });
              }
            })
            .catch(function (error) {
              //axios请求失败回调
              console.log(error);
            });
        }
      });
    },

    // 新增代理商
    agent() {
      if (email(this.form.email) == false && this.form.email!='') {
        layer.open({
          content: "邮箱输入有误",
          skin: "msg",
          time: 1, //1秒后自动关闭
        });
        return false;
      }
      var _this = this;
      const num = /^[0-9]*$/; //验证数字
      console.log(this.form);
      // return
      if (
        _this.form.phone == "" ||
        _this.form.phone.length < 11 ||
        _this.form.phone.length > 11
      ) {
        layer.open({
          content: "请填写正确的手机号！",
          skin: "msg",
          time: 2, //1秒后自动关闭
        });
        return false;
      }
      var regCn = /[·！#￥（——）：；“”‘、，|《。》？、【】[\] ]/im;
      if (regCn.test(_this.form.phone)) {
        layer.open({
          content: "手机号码不能含有特殊字符",
          skin: "msg",
          time: 2, //1秒后自动关闭
        });
        return false;
      }

      if (/[a-zA-Z]/im.test(_this.form.phone)) {
        layer.open({
          content: "手机号码不能含有字母",
          skin: "msg",
          time: 2, //1秒后自动关闭
        });
        return false;
      }
      if (!/^1[3|4|5|7|8|9][0-9]\d{4,8}$/.test(_this.form.phone)) {
        layer.open({
          content: "手机号码填写有误",
          skin: "msg",
          time: 2, //1秒后自动关闭
        });
        return false;
      }
      for (var s = 0; s < _this.huiyuanzhazi.length; s++) {
        if (_this.huiyuanzhazi[s].uid == _this.form.merUid) {
          _this.form.level = _this.huiyuanzhazi[s].level;
          _this.form.merName = _this.huiyuanzhazi[s].name;
        }
      }
      _this.form.oemUid = localStorage.getItem("uid");
      console.log("下面是传递的参数");
      console.log(_this.form);
      this.form.merUid = this.dataes;
      console.log(this.form);
      this.$refs["form"].validate((valid) => {
        if (valid) {
          _this
            .axios({
              //axios请求
              method: "post",
              url: "/api/office/save",
              data: _this.form,
            })
            .then(function (d) {
              console.log("发请求了没");
              console.log(d);
              // alert(JSON.stringify(d))
              if (d.data.code == "0000") {
                // alert("成功了了")
                layer.open({
                  content: d.data.msg,
                  skin: "msg",
                  time: 3, //1秒后自动关闭
                });
                _this.$emit("type", 1);
                setTimeout(() => {
                  _this.$router.push({
                    path: "mechanismaa",
                  });
                }, 3000);
              } else {
                layer.open({
                  content: d.data.msg,
                  skin: "msg",
                  time: 2, //1秒后自动关闭
                });
              }
            })
            .catch(function (error) {
              //axios请求失败回调
              console.log(error);
            });
        } else {
          layer.open({
            content: "请检查表单完整性",
            skin: "msg",
            time: 2, //1秒后自动关闭
          });
        }
      });
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    showdou() {
      this.$refs.mychild.parentHandleclick();
    },

    /*上传图片*/
    handleRemove(file, fileList) {},
    handlePictureCardPreview(file) {},
    handleAvatarSuccess(res, file) {
      // this.imageUrl = URL.createObjectURL(file.raw);
    },
    uploadOk(val) {
      var formdata = new FormData();
      //可以通过append()方法来追加数据
      formdata.append("upfile", val.file);
      formdata.append("up_type", 1);
      this.up = formdata;
      this.$axios({
        method: "post",
        url: "v1/upload",
        data: this.up,
      }).then((res) => {
        if (res.status == 200) {
          this.dialogImageUrl = res.data.file_url;
        }
      });
    },

    // 开户银行下拉框
    openBankList() {
      // alert("获取开户银行信息")
      var _this = this;
      _this
        .axios({
          //axios请求
          method: "post",
          url: "/bank/queryBank",
          data: {},
        })
        .then(function (d) {
          // console.log(JSON.stringify(d) + "00000");
          if (d.data.code == "0000") {
            _this.bankList = d.data.data;
            /*  _this.form.toOfficeUid = d.data.oemuid;*/
          } else {
            layer.open({
              content: d.data.msg,
              skin: "msg",
              time: 2, //1秒后自动关闭
            });
          }
        })
        .catch(function (error) {
          //axios请求失败回调
          console.log(error);
        });
    },
    // 开户支行
    openBranchList() {
      if (this.form1.openCity != "" && this.form1.bankCode != "") {
        axios
          .post("/bank/querySubBank", {
            cityCode: this.form1.openCity,
            bankCode: this.form1.bankCode,
          })
          .then((res) => {
            if ((res.data.code = "0000")) {
              this.branchList = res.data.data;
            }
          });
      }
    },
    //切换显示类型
    changeType(e) {
      console.log(e);
      if (e == 1  ) {
        this.showType = 2;
        this.form1.agtType = "0";
      }else if(e == 3){
        this.showType = 2;
        this.form1.agtType = "3";
      } 
      else {
        this.showType = e;
        this.form1.agtType = "1";
      }

      // if(this.showType==0)
      //   this.showType = 2
      // else
      //   this.showType = 0
    },
  },
};
</script>

<style scoped>
/deep/ .el-input__inner {
  width: 100% !important;
}
/deep/ .appointVip .el-input {
  width: 160px;
  margin-right: 10px;
}
/deep/ .appointVip .el-input__inner {
  width: 160px;
}
/deep/ .appointVips .el-input {
  width: 168px;
  margin-right: 10px;
}
/deep/ .appointVips .el-input__inner {
  width: 168px;
}
.con {
  position: relative;
}
/* 单独样式 */
.contbox6_10 {
  width: 100%;
  box-sizing: border-box;
}
.sousuojg6_10 {
  float: left;
  font-size: 16px;
  color: #222;
  box-sizing: border-box;
  background-color: #f6f6f6;
  border-radius: 5px;
}
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 256px;
  height: 160px;
  line-height: 160px;
  text-align: center;
}
.avatar {
  width: 256px;
  height: 160px;
  display: block;
  border-radius: 4px;
}
.cardNo {
  text-align: center;
  font-size: 14px;
}
.list {
  float: left;
  /* width: 50%; */
}
.listers {
  width: 520px !important;
  box-sizing: border-box;
  float: left;
}
.withList {
  width: 520px !important;
  float: left !important;
}
.wraps {
  display: flex;
  align-items: center;
}
.detailAddress {
  position: relative;
  /* right: 410px; */
}
.titlser {
  font-size: 16px;
  /* font-weight: bold; */
  padding-left: 28px;
}
.jibenInfo {
  width: calc(100% - 40px);
  margin: 20px;
  height: 40px;
  line-height: 40px;
  padding-left: 20px;
  background: #f9fafc;
  float: left;
}
.jibenInfo .el-form-item__label {
  font-size: 18px;
  color: #2f2c29;
}
.clearfix:after {
  display: block;
  height: 0;
  clear: both;
  content: ".";
  visibility: hidden;
}
.list {
  width: 570px !important;
}
.lis {
  width: 300px !important;
}
.smalls .el-input {
  width: 150px;
}
/deep/ .selectHui .el-input__inner {
  width: 148px;
}
.el-cascader {
  line-height: 32px;
}
.lists {
  width: 422px;
}
.adsInput .el-input__inner {
  width: 300px;
}
.detailAddress .el-input__inner {
  margin-left: -157px;
  width: 150px;
}
.adsPhon .el-input,
.adsPhon .el-input__inner {
  width: 817px;
}
.detailAds .el-input__inner {
  width: 300px;
}

/deep/ .selectHui .el-input {
  width: 148px !important;
}
/deep/ .payNo .el-input {
  width: 300px !important;
}
/deep/ .el-select-dropdown {
  width: 300px !important;
}

/deep/ .el-popper {
  width: 300px !important;
}
/deep/ .rules .el-input {
  width: 200px;
}
/deep/ .el-input {
  width: 100%;
}
/deep/ .rules .el-input__inner {
  width: 200px;
}
.boxer[data-v-6c7b9f88] {
  float: left !important;
}
.boxer {
  /* padding-right: 10px; */
  float: right !important;
  margin-bottom: 20px;
}
.boxer > .el-button {
  width: 100px;
  height: 40px;
  float: right !important;
}

@media screen and (max-width: 1380px) {
  #adrs {
    width: 100% !important;
  }
}
.el-form-item {
  margin-bottom: 20px;
}
.el-form-item p {
  text-align: center;
}
/deep/ .textarea {
  height: 100px !important;
}
/deep/ .selects > .el-input {
  width: 350px;
}
/deep/ .textArea > .el-textarea__inner {
  height: 150px;
}
</style>
<style rel="stylesheet/scss">
.disabled .el-upload--picture-card {
  display: none;
}
</style>
